-
Notifications
You must be signed in to change notification settings - Fork 4
refactor/bytes #88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor/bytes #88
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR refactors byte handling utilities to leverage the Effect library's built-in Schema.Uint8ArrayFromHex schema instead of custom implementations. The changes eliminate redundant code, improve maintainability, and standardize hex-to-bytes conversions across the codebase.
Key Changes:
- Replaced custom
Bytes.FromHexwithSchema.Uint8ArrayFromHexthroughout the codebase - Simplified byte utility modules by removing custom hex validation and conversion logic
- Updated equality function naming from
bytesEqualstoequalsfor consistency - Refactored various BytesN modules to use simpler schema compositions
Reviewed changes
Copilot reviewed 300 out of 359 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/evolution/src/core/Bytes.ts |
Removed extensive custom hex conversion logic; simplified to use Effect's native schemas |
packages/evolution/src/core/EnterpriseAddress.ts |
Updated to use Schema.Uint8ArrayFromHex instead of Bytes.FromHex |
packages/evolution/src/core/Ed25519Signature.ts |
Changed equality check to use Bytes.equals |
packages/evolution/src/core/DnsName.ts |
Refactored to use simplified Text128 schemas and point-free function style |
packages/evolution/src/core/DataJson.ts |
Introduced local HEX_REGEX to replace Bytes.isHex |
packages/evolution/src/core/CBOR.ts |
Updated CBOR hex conversion to use Schema.Uint8ArrayFromHex and Bytes.fromHex |
packages/evolution/src/core/Bytes96.ts |
Simplified schema definitions by removing custom transformation logic |
packages/evolution/src/core/Combinator.ts |
Replaced Bytes.isHex with local HEX_REGEX.test |
| Various address/certificate files | Consistently updated to use Schema.Uint8ArrayFromHex |
| Documentation files | Updated nav_order values and type signatures to reflect schema changes |
packages/evolution/package.json |
Added @emurgo/cardano-message-signing-nodejs dependency |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Update Text.toBytesUnsafe to Text.toBytes - UTF-8 encoding matches Aiken spec
No description provided.